<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
</head>
<body>
<button type="button" id="btn1">测试click事件-事件绑定</button>
<input type=button id="btn2" value="测试click事件-直接调用" onclick="javascript: showme()">
</body>
</html>
<script>
function showme(){
alert (document.getElementById("btn2").value)
}
document.getElementById("btn1").addEventListener("click",function(){
alert (document.getElementById("btn1").innerHTML)
});
</script>